<%--
功能：获得货品
--%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ tag import="org.springframework.context.ApplicationContext" %>
<%@ tag import="org.springframework.web.context.support.WebApplicationContextUtils" %>
<%@ tag import="com.probiz.estore.common.model.product.ProductSku" %>
<%@ tag import="com.probiz.estore.product.service.ProductSkuManager" %>

<%@ attribute name="productSkuId" type="java.lang.Integer" required="false" description="货品id"%>
<%@ attribute name="productSkuCode" type="java.lang.String" required="false" description="货号"%>
<%@ attribute name="returnProductSkuName" type="java.lang.String" required="true" description="返回实体名"%>

<%
	ApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(session.getServletContext());
	ProductSkuManager productSkuManager = (ProductSkuManager) ctx.getBean("productSkuManager");
	ProductSku targetProductSku = null;
	if(null != productSkuId){
		targetProductSku = productSkuManager.getById(productSkuId);
	}else if(null != productSkuCode){
		targetProductSku = productSkuManager.getProductSkuByProductSkuCode(productSkuCode);
	}
	request.setAttribute(returnProductSkuName,targetProductSku);
%>

